package com.androidhive.androidlistview;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MyWebViewClient extends WebViewClient {
	 public final static String cropId="hk";
	
	
    
    private Context context;

    public MyWebViewClient(Context context) {
        this.context = context;
    }
    
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
       // if(url.equals("hrupin://second_activity")){
        	  if(url.contains("hk")){
        		  String Id=url.substring(2);
         Intent i = new Intent(context, LoginActivity.class);
         Log.d("here","krishna");
       i.removeExtra(cropId);
       
         i.putExtra(cropId, Id);
            context.startActivity(i);
            return true;
        }
        return super.shouldOverrideUrlLoading(view, url);
    }
}
